<?php $this->load->view("general/header");?>

<div id="create_invoice" class="page_">
    <div class="form">              
        <div class="form_header">Tambah Barang Masuk Ke Gudang</div>
        <div class="form_header_right"></div>
        
        <div class="form_header_right1"></div>
        <div class="content_data">
        <form method="post" action="<?php echo site_url("inItem/index");?>">
           
          	
          	<div class="row">
            	<div class="col1">Pegawai Pengisi</div>
                <div class="col2"><?php echo get_username($this->session->userdata("user_id"));?></div>
			</div>
            <div class="row">
            	<div class="col1">Kode Barcode</div>
                <div class="col2"><input type="text" name="barcode" id="barcodeHistory" /> 
                	<div class="errorField"><?php echo form_error("barcode");?></div>
                </div>
			</div>
            <div id="autoPlace">
            <input type="text" name="id_item" id="id_item" style="display:none" />
            <input type="text" name="stokSkr" id="stokSkr" style="display:none" />
                <div class="row">
                    <div class="col1">Nama</div>
                    <div class="col2"><div class="ui-widget"><input type="text" name="nama_barang" id="susgest1inItem" /></div> 
                        <div class="errorField"><?php echo form_error("nama_barang");?></div>
                    </div>
                </div>
                
                <div class="row">
                    <div class="col1">Merk Barang</div>
                    <div class="col2" id="merkPlace">
                    	<input type="text" id="merk"  name="merk" readonly="readonly"/></div>
                </div>
                <div class="row">
                    <div class="col1">Jenis Barang</div>
                    <div class="col2" id="catPlace">
                        <input type="text" id="cat"  name="cat" readonly="readonly"/></div>
                </div>
            </div>
            
                <div class="row">
                    <div class="col1">Stok Keluar</div>
                    <div class="col2"><input type="text" name="stok" placeholder="0" id="stok"/> 
                        <div class="errorField"><?php echo form_error("stok");?></div>
                    </div>
                </div>
                
                <div class="row">
            		<div class="col1">Tujuan Barang</div>
                	<div class="col2" id="cabPlace">
                        <select  id="nameCab"  name="nameCab">
                                <option value="" selected="selected">::: Pilih Tujuan :::</option>
                                <?php foreach ($cab as $cab1){?>
                                    <option value="<?php echo $cab1['cabang_name'];?>"><?php echo $cab1['cabang_name'];?></option>
                                <?php }?>
                        </select>
                	
                	</div>
                    <img src="<?php echo base_url();?>image_tinymce/add.jpg" id="refreshimgCab"/>
              
				</div>

                
            
            
            
            
        </div>
        <div class="title" align="right">
          	<input type="submit" name="btnSave" value="Simpan" class="button_red" />
        </div>
        <div class="success"><?php echo (isset($success))?$success:"";?>&nbsp;</div>
        </form>
        	<strong>Barang Yang Baru Keluar Dari Gudang</strong>
         	<div id="pager1" class="pager1">
        		<table id="background-image"> 
                    <thead> 
                        <tr> 
                        	<th>Barcode</th>
                            <th>Merk</th>
                            
                            <th>Jenis</th>
                            <th>Nama</th> 
                            <th>Jumlah Keluar</th>
                            <th>Nama Staff</th>
                            <th>Tanggal Dan Jam</th>
                            <th>Diubah Oleh</th>
                            <th>Alasan Ubah</th>
                            <th>Action</th>
                           
                        </tr> 
                    </thead> 
                    <tbody> 
                        <?php foreach ($added as $added1){?>
                        
                        <tr>
                        	<td width="13%"><?php echo $added1['barcode_id'];?></td>
                        	<td><?php echo $added1['item_merk'];?></td>
                             
                            <td><?php echo $added1['item_cat'];?></td> 
                            <td width="13%"><?php echo $added1['item_name'];?></td> 
                            <td><?php echo $added1['stock_out'];?></td>
                            <td><?php echo $added1['namasales'];?></td>
                            <td><?php echo $added1['date'];?></td>
                            <td><?php echo $added1['change_by'];?></td>
                            <td><?php echo $added1['reason'];?></td>
                            <td align="center" width="13%"><a href="<?php echo site_url('inItem/edit/' . $added1['inItem_id'] . '/fromadd/')?>">Ubah</a> | <a href="<?php echo site_url('inItem/delete/'. $added1['inItem_id']) .'/'.$added1['stock_out'].'/'.$added1['id'].'/fromadd'?>" onclick="return confirm('Apakah Anda ingin menghapus data <?php echo $added1['item_name'];?>\n(Stok <?php echo $added1['item_merk'] . " " . $added1['item_name'];?> akan berkurang <?php echo $added1['stock_out']; ?>) ?')">Hapus</a></td>
                            
                                               
                        </tr> 
                        <?php } ?>
                       
                   </tbody> 
                    
			</table> 
           </div> 
            <form>
                <img src="<?php echo base_url();?>img/first.png" class="first" title="back to first"/>
                <img src="<?php echo base_url();?>img/prev.png" class="prev" title="previous"/>
                <input type="text" class="pagedisplay"/>
                <img src="<?php echo base_url();?>img/next.png" class="next" title="next"/>
                <img src="<?php echo base_url();?>img/last.png" class="last" title="go to last"/>
               
                <select class="pagesize">
                    <option selected="selected"  value="10">10</option>
                	<option value="15">15</option>
                    
                </select>
            
        	</form>
    </div>
    <div id="dialog-form-cabang" title="Tambah Data Tujuan Barang">
    	<p class="validateTips">Harus diisi semua</p>
 
        <form>
        <fieldset>
            <label for="name">Nama Tujuan</label>
            <input type="text" name="nameCab" id="nameCabang" class="text ui-widget-content ui-corner-all" />
                            
        </fieldset>
        </form>
    </div>
	<div id="dialog-form-merk" title="Tambah Data Merk barang">
    	<p class="validateTips">Harus diisi semua</p>
 
		<form>
        <fieldset>
            <label for="name">Nama Merk</label>
            <input type="text" name="nameMerk" id="nameMerk" class="text ui-widget-content ui-corner-all" />
                            
        </fieldset>
        </form>
	</div>
</div>
<?php $this->load->view("general/footer");?>